#ifndef GAME_H
#define GAME_H

#include "Util/Log.h"
#include "Util/LensflareConfig.h"
#include "Player.h"
#include "WrappedContainers/LinkedList.h"

class Game {
protected:
	static int currentPlayerIndex;
	static Player player[2];
	static bool hudEnabled;
	static bool helpViewEnabled;
    static bool fpsEnabled;
	static int winnerIndex;
	static float mouseSensivity;
	static bool debugMode;

public:
	static Log log;
	static Lensflare::Config config;
	static bool waitingForNextTurn;

public:
	static void Init();
	static void Reset(bool userFeedback);

	inline static bool IsInDebugMode() { return debugMode; }

	static void Tick();

	static inline float GetBrickSize() { return 0.40f; }
	static inline float GetPlacementSnapDistance() { return GetBrickSize()*10; }
	static inline float GetMouseSensivity() { return mouseSensivity; }

	static inline int GetCurrentPlayerIndex() { return currentPlayerIndex; }
	static inline Player* GetCurrentPlayer() { return &player[currentPlayerIndex]; }
	static inline Player* GetPlayer(int index) { return &player[index]; }

	static inline int GetBuildAreaDimension() { return 15; }

	static inline int GetGoldForHit() { return 100; }

	static void SelectNextPlayer();
	inline static bool WinnerEncountered() { return winnerIndex >= 0; }
	inline static Player* GetWinner() { return WinnerEncountered() ? &player[winnerIndex] : NULL; }

	static void SetRandomWind();

	static inline bool IsHudEnabled() { return hudEnabled; }
	static inline bool IsHelpViewEnabled() { return helpViewEnabled; }
    static inline bool IsFPSEnabled() { return fpsEnabled; }

	static void ToggleHud();
    static void ToggleHelpView();
    static void ToggleFPS();

	static void UserPlace();
	static void UserClear();
	static void UserShoot();
};

#endif //GAME_H
